//C19:Listing 19.11 -- function object.
#include <iostream>
using namespace std;

template<class T>
class Print
{
    public:
        void operator()(const T& t)
        {
            cout << t << " " << endl;
        }
};

int main(void)
{
    Print<int> DoPrint;
    for (int i = 0; i < 5; i++)
    {
        DoPrint(i);
    }
}